﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Twi.COMMON.WCF
{
    public static class IntExtensions
    {
        public static string ToStringZhCN(this int me) 
        {
            var values = new string[] { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十" };
            if (me <= 10)
            {
                return values[me];
            }
            else if (me < 100)
            {
                int tens = me / 10;
                int singles = me % 10;
                return (tens == 1 ? "" : values[tens]) + "十" + values[singles];
            }
            else if (me >= 100)
            {
                return me.ToString();
            }
            else
            {
                return me.ToString();
            }
        }
    }
}
